﻿using Schism.libs;
using Schism.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Schism.IO
{
    [Serializable]
    public sealed class WorldIO : IAssignable<LevelBase, WorldIO>
    {
        //Fields
        public CellMap WorldCellMap;

        //ctor
        public WorldIO()
        {

        }

        //Methods
        public void Save(string filename)
        {
            IOHandle.Save<WorldIO>(filename, this);
        }
        public void Load(string filename)
        {
            AssignToo(IOHandle.LoadFrom<WorldIO>(filename));
        }

        public void ExtractFrom(LevelBase obj)
        {

        }
        public void AssignToo(WorldIO obj)
        {
            this.WorldCellMap = obj.WorldCellMap;
        }

        public void Assign(LevelBase obj)
        {
            obj.GameCellMap = this.WorldCellMap;
        }
    }
}
